<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                      "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title>Device Properties Example</title>

    <script type="text/javascript" charset="utf-8" src="phonegap.0.9.4.js"></script>
    <script type="text/javascript" charset="utf-8">
    function getLocation() {
        // Error callback function telling the user that there was a problem retrieving GPS.
        var fail = function(error){
             if (navigator.notification.activityStop) navigator.notification.activityStop(); // only call this if the function exists as it is iPhone only.
             alert("Failed to get GPS location");
        };
        if(navigator.geolocation) {
             if (navigator.notification.activityStart) navigator.notification.activityStart(); // only call this if the function exists as it is iPhone only.
             // Success callback function that will grab coordinate information and display it in an alert.
             var suc = function(p) {
                   if (navigator.notification.activityStop) navigator.notification.activityStop(); // only call this if the function exists as it is iPhone only.
                   alert("Latitude:"+p.coords.latitude + " " + p.coords.longitude);
             };
             // Now make the PhoneGap JavaScript API call, passing in success and error callbacks as parameters, respectively.
             navigator.geolocation.getCurrentPosition(suc,fail);
        } else {
             fail();
        }
   }
    </script>
  </head>
  <body>
  		<a href="index.html">Example 1</a>
		<a onclick="getLocation();" href="#">Click me to get the GPS location</a>
  </body>
</html>